@extends('master')

@section('title')
Scool|Info
@endsection

@section('content')

 <!-- right-top -->
    <div class="right-info" id="scrol3">
      <div class="right-info-wrapper" id="right-info-wrapper">
       <input type="hidden" id="robotCount" data-id=<?php echo $data->robotCount; ?> >
        <!-- height_22 -->
        <div class="table-list-info">
          <div class="panel panel-default">
            <div class="panel-heading">
              <div class="create-info">
                <div class="create-info-left"> <span>Info 列表</span> </div>
                <!-- create-info-left -->
              
                <!-- create-info-right -->
                <!-- clear --> 
              </div>
              <!-- create-info --> 
            </div>
            <!-- panel-heading -->
            <div class="panel-body">
              <div class="table-detail table-responsive">
                <table class="table table-condensed table-pad">
                  <thead>
                    <tr>
                    
                      <th>Id</th>
                      <th>Title</th>
                      <th>Location</th>
                      <th>Like</th>
                      <th>Comment</th>
                      <th>Status</th>
                      <th>Username</th>
                      <th>CreateTime</th>
                      <th>Description</th>
                      <th>Weight</th>
                      <th>Action</th>
                    </tr>
                  </thead>
                  <tbody>
                   <?php foreach($data as $value): ?>
                    <tr>
                      <td ><?php echo $value->id ?></td>
                      <td ><?php echo $value->title ?></td>
                      <td ><?php echo $value->location; ?></td>
                      <td ><?php echo $value->like; ?></td>
                      <td ><?php echo $value->comment; ?></td>
                      <td ><?php echo $value->status ? '发布' : '删除'; ?></td>
                      <td ><?php echo $value->username; ?></td>
                      <td ><?php echo date('Y-m-d H:i:s', $value->create_time); ?></td>
                      <th>
                        <?php if($value->description): ?>
                            <span data-descr="<?php echo $value->description ?>"><?php echo  mb_substr($value->description, 0, 10, 'utf-8').'....' ?></span>
                        <?php endif; ?>
                      </th>
                      <td ><?php echo $value->weight; ?></td> 
                      <td><!-- Single button -->
                        
                        <div class="btn-group">
                          <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Action <span class="caret"></span> </button>
                          <ul class="dropdown-menu">
                        
                            <li><a href="/info/update?id=<?php echo $value->id; ?>">Info详情</a></li>
                            <li><a href="/comment?id=<?php echo $value->id; ?>">Info评论列表</a></li>
                            <li><a href="javascript:;" data-id=<?php echo $value->id; ?> class="addLike" >Robot点赞</a></li>

                            <!-- <li><a href="javascript:;" data-toggle="modal" data-target="#myModal" data-id="<?php echo $value->id ?>" class="delete">删除Info</a></li> -->
                           
                          </ul>
                        </div>
                        </td>
                    </tr>
                  <?php endforeach; ?>

                  <?php if(!$data): ?>
                     <tr> <td colspan="5" class="td-pad">No data found</td></tr>
                    <?php endif;?>   
                      
                  </tbody>
                </table>
              </div>
              <!-- table-detail --> 
            </div>
            <span class="span_top"><?php echo $data->total(); ?> Records</span>{!! $data->render() !!}
            <!-- panel-body --> 
          </div>
          <!-- panel --> 
        </div>
        <!-- table-list-info -->
        <div class="height_50"></div>
        <!-- height_50 --> 
      </div>
      <!-- right-info-wrapper --> 
    </div>
    <!-- right-info --> 
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="myModalLabel">确认删除</h4>
          </div>
          <div class="modal-body"> 是否确认删除这一项 </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-primary btn-lg btn-pad deleteConfirm" data-dismiss="modal" >OK</button>
          </div>
        </div>
      </div>
    </div>


@endsection


@section('js')
<!-- <script type="text/javascript"  src="/js/autocomplete.js"></script> -->
<script type="text/javascript"  src="/js/info/index.js"></script>
@endsection